package com.icode.core.dto.manager;

import com.icode.core.dto.house.HouseWeekTimeDTO;
import com.icode.core.model.house.MyHouseStatus;
import com.icode.core.model.manage.ReserveTime;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: lb
 * Date: 15-12-29
 * Time: 下午1:08
 * To change this template use File | Settings | File Templates.
 */
public class ReserveTimeDTO {
    private String guid;
    private HouseWeekTimeDTO houseWeekTimeDTO;
    private MyHouseStatus status;

    public ReserveTimeDTO() {

    }

    public ReserveTimeDTO(HouseWeekTimeDTO houseWeekTimeDTO,MyHouseStatus status) {
        this.houseWeekTimeDTO = houseWeekTimeDTO;
        this.status = status;
    }

    public static ReserveTimeDTO toDTO(ReserveTime reserveTime) {
        HouseWeekTimeDTO houseWeekTimeDTO = HouseWeekTimeDTO.toDTO(reserveTime.houseWeekTime());
        return new ReserveTimeDTO(houseWeekTimeDTO,reserveTime.status());
    }

    public static List<ReserveTimeDTO> toDTOs(List<ReserveTime> reserveTimes){
        List<ReserveTimeDTO> reserveTimeDTOs = new ArrayList<>();
        for(ReserveTime reserveTime:reserveTimes){
            ReserveTimeDTO reserveTimeDTO = toDTO(reserveTime);
            reserveTimeDTOs.add(reserveTimeDTO);
        }
        return reserveTimeDTOs;
    }

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public HouseWeekTimeDTO getHouseWeekTimeDTO() {
        return houseWeekTimeDTO;
    }

    public void setHouseWeekTimeDTO(HouseWeekTimeDTO houseWeekTimeDTO) {
        this.houseWeekTimeDTO = houseWeekTimeDTO;
    }


    public MyHouseStatus getStatus() {
        return status;
    }

    public void setStatus(MyHouseStatus status) {
        this.status = status;
    }
}
